<template>
    <el-dialog class="dialog" :destroy-on-close="true" :title="title" :visible.sync="isShow" :close-on-click-modal="false"
        @close="onDialogClose">
        <el-form ref="form" label-width="auto" class="form" :model="formData" :rules="rules">
            <el-form-item label="门禁编号" prop="door_guid">
                <el-input :disabled="isEdit" v-model="formData.door_guid" placeholder="请输入门禁编号" maxlength="50"></el-input>
            </el-form-item>
           
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="onDialogClose">取消</el-button>
            <el-button type="primary" @click="onSubmit">确认</el-button>
        </div>
    </el-dialog>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator"; //, Prop
import { Action } from "vuex-class";
import { mixinDialogForm } from "@/mixin/dialog/Form";
@Component({
    mixins: [mixinDialogForm]
})
export default class equipmentDoorEdit extends Vue {
    // 新增
    @Action("kqDoor/add") itemAdd: any;


    // 表单数据
    formData: any = {
        door_guid: ""
    };

    /**
     * 校验配置
     *
     * @type {*}
     * @memberof mixinViewRules
     */
    rules: any = {
        door_guid: [
            {
                required: true,
                message: "请输入门禁编号",
                trigger: "blur"
            }
        ]
    };
    // 标题
    get title() {
        const title = (this as any).isEdit ? "编辑" : "新增";
        return `${title}考勤门禁`;
    }


}
</script>